package com.leetcode.LC;

public class LC1470 {
    public int[] shuffle(int[] nums, int n) {
        if (n == 1) {
            return nums;
        }
        int[] ints1 = new int[n];
        int[] ints2 = new int[n];

        for (int i = 0; i < n; i++) {
            ints1[i] = nums[i];
        }
        for (int i = n; i < 2 * n; i++) {
            ints2[i - n] = nums[i];
        }

        int a = 0;
        for (int i = 0; i < n; i++) {
            nums[a] = ints1[i];
            nums[a + 1] = ints2[i];
            a += 2;
        }
        return nums;
    }
}
